<template>
  <div class="app-container">

    <h2 style="text-align: center;">提现处理</h2>

    <el-steps :active="2" process-status="wait" align-center style="margin-bottom: 40px;">
      <el-step title="确认体现信息"/>
      <el-step title="人工操作"/>
      <el-step title="订单流水录入"/>
    </el-steps>
    <h2 style="margin-left: 25%">请认真核对信息进行转账</h2>
    <div style="margin-left: 25%; margin-bottom: 1%">
      <label>  金额拥有:</label>
      <el-input
        v-model="this.drawDraw.money"
        clearable
        :disabled="true"
        style="width: 10% ">
      </el-input>
      <label>  提现金额:</label>
      <el-input
        v-model="this.drawDraw.drawMoney"
        clearable
        :disabled="true"
        style="width: 10%">
      </el-input>
      <label>  剩余金额:</label>
      <el-input
        v-model="this.drawDraw.finMoney"
        clearable
        :disabled="true"
        style="width: 10%">
      </el-input>
    </div>
    <div style="margin-left: 25%">
      <label>  支付宝账号:</label>

      <el-input
        v-model="this.drawDraw.zfbId"
        clearable
        :disabled="true"
        style="width: 10% ">
      </el-input>

      <label>  姓名:</label>

      <el-input
        v-model="this.drawDraw.name"
        clearable
        :disabled="true"
        style="width: 10% ">
      </el-input>


    </div>




    <div>
      <router-link :to="{name:'dealDraw',query:{id}}">
        <el-button style="margin-top: 12px; margin-right: 45%;margin-left: 20%">上一步</el-button>
      </router-link>

      <router-link :to="{name:'artificialDraw',query:{id}}">
        <el-button style="margin-top: 12px"  @click="saveDrawMoney()">保存并下一步</el-button>
      </router-link>
    </div>
  </div>



</template>


<script>
  import {findAllDrawMoneyById} from  '@/api/worker'
  import {findDetailInfoById} from  '@/api/worker'
  export default {
    data() {
      return {
        id:this.$route.query.id,
        active: 0,
        list:null,
        drawDraw:{
          money: '',
          zfbId:'',
          name:''

        }
      };
    },
    created() {

      //获取信息渲染数据
      this.getDrawAppeal()
    },


    methods: {
      //下一步按钮
      saveDrawMoney(){
        // 冻结提示
        this.$confirm('是否已成功转账?', '提示', {
          confirmButtonText: '转账成功',
          cancelButtonText: '转账失败',
          type: 'warning'
        }).then(() => {

          freezeWorker(row.id).then(result => {

            this.$message({
              message: '转账成功',
              type: 'success'
            })
            row.status = status
            this.getList()
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '转账失败'
          })
        })
      },

      //查询申请清单信息根据id
      getDrawAppeal(){
        findAllDrawMoneyById(this.id).then(result => {
          if (result.data.code===200){
              this.drawDraw.drawMoney = result.data.data.list[0].money
              this.drawDraw.workerId = result.data.data.list[0].workerId


              findDetailInfoById(this.drawDraw.workerId).then(result1 => {
                if (result1.data.code===200) {
                  this.drawDraw.name = result.data.data.list[0].name
                  this.drawDraw.money = result.data.data.list[0].money
                  this.drawDraw.zfbId = result.data.data.list[0].zfbId

                  alert(result.data.data.list[0].zfbId)
                  this.drawDraw.finMoney =  this.drawDraw.money - this.drawDraw.drawMoney
                }
                else {

                }
              })
          }
        })
      },

      next() {
        if (this.active++ > 2) this.active = 0;
      }
    }
  }
</script>
<style scoped>
  .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
  }
</style>
